import { get, post, springBootPost } from '@/utils/request';

export const login = (data: LOGIN.LoginParams) =>
  post('/login', data) as Promise<LOGIN.LoginResult>;

export const registerServices = (data: LOGIN.RegisterParams) =>
  post('/register', data) as Promise<LOGIN.RegisterResult>;

export const getUserInfo = () => get('/users/queryUserInfo') as Promise<LOGIN.UserInfo>;

export const getRole = () => get('/users/getRoleData') as Promise<any>;

export const getUserList = () => get('/users/userList') as Promise<any>;

export const getUserListPost = (data: any) =>
  springBootPost('/users/pagedUserList', data) as Promise<any>;

export const roleListServices = (data: any) =>
  springBootPost('/users/roleTable', data) as Promise<any>;

export const changeCrewLeader = (data: { crewId: number; leaderId: [] }) =>
  springBootPost('/users/changeLeader', data) as Promise<any>;
